package com.dao;

import com.entity.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


public interface UsersMapper {

    @Insert("insert into users (username,password,gender,email,birthday,education,introduce,province) values (#{username},#{password},#{gender},#{email},#{birthday},#{education},#{introduce},#{province})")
    @Options(useGeneratedKeys=true,keyProperty = "uid", keyColumn = "uid")
    public int reg(Users user);  //用户注册

    @Select("select * from users where username=#{uname} and password=#{upass}")
    public Users login(@Param("uname") String username, @Param("upass") String password);
}
